import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
  mode: "history",
  base: process.env.NODE_ENV === "production" ? "/" : "/",
  routes: [
    {
      path: "/",
      component: () => import("@/views/Layout.vue"),
      children: [
        {
          path: "/",
          name: "home",
          component: () => import("@/views/Home.vue"),
          meta: {
            cn: "首页",
            type: "home"
          }
        },
        // -------------------------- 运营 -------------------------------
      // -------------------------- 【核心KPI】概览页 -------------------------------
          {
            path: "dashbord",
            name: "dashbord",
            component: () => import("@/views/operate/dashbord.vue"),
            meta: {
              cn1: "数据中心",
              cn: "dashbord",
              type: "operate"
            }
        },
      // -------------------------- 游戏管理 -------------------------------
        {
          path: "gameList",
          name: "gameList",
          component: () => import("@/views/operate/gameManage/gameList.vue"),
          meta: {
            cn1: "游戏管理",
            cn: "游戏列表",
            type: "operate"
          }
        },
        {
          path: "/researchList",
          name: "researchList",
          component: () => import("@/views/operate/gameManage/researchList.vue"),
          meta: {
            cn1: "游戏管理",
            cn: "研发列表",
            type: "operate"
          }
        },
        // -------------------------- 服务器管理 -------------------------------
        {
          path: "serverList",
          name: "serverList",
          component: () => import("@/views/operate/serverManage/configuration/index.vue"),
          meta: {
            cn1: "服务器管理",
            cn: "服务器列表",
            type: "operate"
          }
        },
        {
          path: "serverMerge",
          name: "serverMerge",
          component: () => import("@/views/operate/serverManage/merge/index.vue"),
          meta: {
            cn1: "服务器管理",
            cn: "服务器合并",
            type: "operate"
          }
        },
        // -------------------------- 客服 -------------------------------
        // -------------------------- 工单管理 -------------------------------
        {
          path: "oderList",
          name: "oderList",
          component: () => import("@/views/customerService/workOder/oderList.vue"),
          meta: {
            cn1: "工单管理",
            cn: "工单列表",
            type: "customerService"
          }
        },
        {
          path: "oderType",
          name: "oderType",
          component: () => import("@/views/customerService/workOder/oderType.vue"),
          meta: {
            cn1: "工单管理",
            cn: "工单类型",
            type: "customerService"
          }
        },
        // -------------------------- 市场 -------------------------------
        // -------------------------- SEM回报数据 -------------------------------
        {
          path: "channelroi",
          name: "channelroi",
          component: () => import("@/views/market/data/channelroi/channelroi.vue"),
          meta: {
            cn: "SEM回报数据",
            cn1: "",
            type: "market"
          }
        },
        // -------------------------- DIY落地页 -------------------------------
        {
          path: "fy11Admin",
          name: "fy11Admin",
          component: () => import("@/views/market/fyAdmin/fy11.vue"),
          meta: {
            cn: "附页11管理",
            cn1: "附页管理",
            type: "market",
          }
        },
        {
          path: "newChannel",
          name: "newChannel",
          component: () => import("@/views/market/newChannel/index.vue"),
          meta: {
            cn: "新增渠道",
            cn1: "渠道管理",
            type: "market"
          }
        },
        {
          path: "cid",
          name: "cid",
          component: () => import("@/views/market/cid/index.vue"),
          meta: {
            cn: "渠道数据",
            cn1: "渠道详情",
            type: "market"
          }
        },
        {
          path: "ccid",
          name: "ccid",
          component: () => import("@/views/market/cid/ccid.vue"),
          meta: {
            cn: "子渠道数据",
            cn1: "渠道详情",
            type: "market"
          }
        },
        {
          path: "ldyList-mk",
          name: "ldyList",
          component: () => import("@/views/market/ldy/ldyList.vue"),
          meta: {
            cn1: "DIY落地页",
            cn: "模板列表",
            type: "market",
          }
        },
        {
          path: "fyList-mk",
          name: "fyList",
          component: () => import("@/views/market/fyAdmin/fyList.vue"),
          meta: {
            cn: "附页列表",
            cn1: "附页管理",
            type: "market",
          }
        },
        {
          path: "fyEdit-mk",
          name: "fyEdit",
          component: () => import("@/views/market/fyAdmin/fy-edit.vue"),
          meta: {
            cn: "编辑附页",
            cn1: "附页列表",
            type: "market",
          }
        },
        // -------------------------- 设计后台 -------------------------------
        {
          path: "ldyList",
          name: "ldyList",
          component: () => import("@/views/market/ldy/ldyList.vue"),
          meta: {
            cn1: "DIY落地页",
            cn: "模板列表",
            type: "design",
          }
        },
        {
          path: "addLdy",
          name: "addLdy",
          component: () => import("@/views/market/ldy/diyLdy.vue"),
          meta: {
            cn1: "DIY落地页",
            cn: "添加模板",
            type: "design"
          }
        },
        {
          path: "modifyLdy",
          name: "modifyLdy",
          component: () => import("@/views/market/ldy/modifyLdy.vue"),
          meta: {
            cn1: "DIY落地页",
            cn: "修改模板",
            type: "design"
          }
        },
        {
          path: "ldyView",
            name: "ldyView",
          component: () => import("@/views/market/ldy/ldyView.vue"),
          meta: {
            cn1: "DIY落地页",
              cn: "模板预览",
              type: "design"
          }
        },
        {
          path: "fyList",
          name: "fyList",
          component: () => import("@/views/market/fyAdmin/fyList.vue"),
          meta: {
            cn: "附页列表",
            cn1: "附页管理",
            type: "design",
          }
        },
        {
          path: "fyEdit",
          name: "fyEdit",
          component: () => import("@/views/market/fyAdmin/fy-edit.vue"),
          meta: {
            cn: "编辑附页",
            cn1: "附页列表",
            type: "design",
          }
        },
        // -------------------------- 权限管理 -------------------------------
        {
          path: "authUserManage",
          name: "authUserManage",
          component: () => import("@/views/authManage/userManage.vue"),
          meta: {
            cn: "用户管理",
            cn1: "权限管理",
          }
        },
        {
          path: "jobsmanage",
          name: "jobsmanage",
          component: () => import("@/views/authManage/JobsManage.vue"),
          meta: {
            cn: "岗位管理",
            cn1: "权限管理"
          }
        },
        {
          path: "groupmanage",
          name: "groupmanage",
          component: () => import("@/views/authManage/GroupManage.vue"),
          meta: {
            cn: "部门管理",
            cn1: "权限管理"
          }
        },
        // -------------------------- 功能模块 -------------------------------
      ]
    },
    {
      path: "/login",
      name: "login",
      component: () => import("@/views/Login.vue")
    },
    {
      path: "/404",
      name: "404",
      component: () => import("@/views/404/404.vue")
    },
    {
      path: "/yunying",
      redirect: '/'
    },
    {
      path: "*",
      redirect: '/404'
    },
  ]
});
